<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace model;

/**
 * Description of TblOpinion
 *
 * @author Damian
 */
class TblOpinion extends Model{
    /**
     * @readwrite
     * @column
     * @primary
     * @type int
     * @length 11
     */
    public $OpinionID;
    const ID="OpinionID";

    /**
     * @readwrite
     */
    public $Content;
    const CONTENT="Content";
    /**
     * @readwrite
     */
    public $AdditionDate;
    const ADDITION_DATE="AdditionDate";
    /**
     * @readwrite
     */
    public $Mark;
    const MARK="Mark";
    /**
     * @readwrite
     */
    public $Moderated;
    const MODERATED="Moderated";
    /**
     * @readwrite
     */
    public $IP;
    const IP="IP";
    /**
     * @readwrite
     */
    public $ShopID;
    const SHOP_ID="ShopID";
    /**
     * @readwrite
     */
    public $ProductID;
    const PRODUCT_ID="ProductID";
    
    /**
     * @readwrite
     */
    public $OpinionType;
    const OPINION_TYPE="OpinionType";
    
    /**
     * @readwrite
     */
    public $CustomerID;
    const CUSTOMER_ID="CustomerID";
    /**
     * @readwrite
     */
    public $Visable;
    const VISABLE="Visable";
    public static function createOrderString($id){
        switch ($id){
            case 1: return [TblOpinion::ADDITION_DATE,"asc",  TblOpinion::getModel()->getTable()];
            case 2: return [TblOpinion::ADDITION_DATE,"desc",  TblOpinion::getModel()->getTable()];
            case 3: return [TblOpinion::MARK,"asc",  TblOpinion::getModel()->getTable()];
            case 4: return [TblOpinion::MARK,"desc",  TblOpinion::getModel()->getTable()];
            case 5: return [TblPerson::SURNAME,"asc",  TblPerson::getModel()->getTable()];
            case 6: return [TblPerson::SURNAME,"desc",  TblPerson::getModel()->getTable()];
            case 7: return [TblProduct::NAME,"asc",  TblProduct::getModel()->getTable()];
            case 8: return [TblProduct::NAME,"desc",  TblProduct::getModel()->getTable()];
            default :return [TblOpinion::ADDITION_DATE,"asc",  TblOpinion::getModel()->getTable()];
        }
    }
    
}
